1. Field of the Invention
The present invention relates to an emulator system and emulation method for supporting program development of microcomputers.
2. Description of Related Art
FIG. 8 is a schematic view of a program development system employing a conventional emulator system. In this figure, the reference numeral 1 designates a host computer; 2 designates a target board on which a microcomputer 3 is mounted; 3 designates the microcomputer; 4 designates an emulator system for debugging a program under development during program development of the microcomputer 3; 4a designates a probe of the emulator system 4 connected to a socket 2a of the target board 2; and 5 designates a communication cable for connecting the emulator system 4 with the host computer 1.
FIG. 9 is a block diagram showing a conventional emulator system 4. In this figure, the reference numeral 6 designates a timer embedded in the microcomputer 3; 7 designates a communication interface circuit for controlling the communications between the host computer 1 and a monitor circuit 8; 8 designates the monitor circuit for receiving a program to be debugged from the host computer 1, and transfers it to an emulation memory 9; 9 designates the emulation memory for storing the program to be debugged and a task execution history; 9a designates a task execution history recording memory area for recording the task execution history; 10 designates an address bus; 11 designates a data bus; and 12 designates a bus for transmitting a status signal indicating the state of the microcomputer 3.
Next, the operation will be described.
To carry out debugging of the program of the microcomputer 3 mounted on the target board 2, a debugger (debugging support program) is started in the host computer 1.
The debugger, having been started, transmits the program (program linked with a real time OS) of the microcomputer 3, which is to be debugged, from the host computer 1 to the monitor circuit 8 through the communication interface circuit 7.
Receiving the program of the microcomputer 3 to be debugged from the host computer 1, the monitor circuit 8 transfers the program to the emulation memory 9.
Once the program of the microcomputer 3 to be debugged has been stored in the emulation memory 9, the monitor circuit 8 controls the microcomputer 3 in accordance with commands transmitted from the host computer 1. Then, the microcomputer 3 executes processing such as executing the program to be debugged stored in the emulation memory 9.
More specifically, since the program linked with the real time OS is complex and consists of multiple tasks (a set of modules called tasks managed module by module), the individual tasks are executed according to a schedule planned by the scheduler of the real time OS.
Thus, the scheduler of the real time OS sequentially determines the task to be executed next, in which case the microcomputer 3 stores the identification number of a task to be executed next in the task execution history recording memory area 9a in the emulation memory 9, using a task which is incorporated in the program to be debugged for storing in the task execution history recording memory area 9a the identification number of the task to be executed next.
When switched to the task to be executed next, the microcomputer 3 identifies the switch time by referring to the timer 6 embedded in the microcomputer 3, and stores the switch time of the task in the task execution history recording memory area 9a of the emulation memory 9 using a task which is incorporated in the program to be debugged for storing the task switch time in the task execution history recording memory area 9a.
Thus, program developers can recognize the history of task execution by referring to the recorded contents (the identification numbers of the next executed tasks and the task switch times) in the task execution history recording memory area 9a in the emulation memory 9 after the completion of the program to be debugged, thereby achieving the debugging of the program.
With the conventional emulator system configured as described above, the program to be debugged must be provided with a specific task for storing the identification number and the switch time of the task to be executed next the task execution history recording memory area 9a. Such a task, however, becomes unnecessary after debugging, and hence must be deleted from the debugged program after completing the debugging. The reason that the task for storing the identification number and the switch time must be deleted is if the debugged program incorporating that task is installed in the microcomputer 3, the overall performance of the program will be degraded. This presents a further problem in that the program actually installed in the microcomputer 3 differs from the debugged program.
In addition, since the timer 6 used only for debugging must be provided in the microcomputer 3 to identify the switch time of the task, a problem arises in that the timer 6 becomes a useless resource after the debugging.
Moreover, although the history of task execution can be identified after executing the program to be debugged, a means for identifying the history of task state transition is not provided. This presents a problem of hindering sufficient debugging from being achieved in some cases.